home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Development Platforms / LISP Related / MCL Networking / Network / NETWORK-DEFS.lisp < prev    next >
Encoding:
Text File  |  1990-08-31  |  9.9 KB  |  377 lines  |  [TEXT/CCL ]

  1. ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
  2. ;;; Copyright 1987, 1988, 1989, 1990 by Ruben Kleiman for Apple Computer, Inc.
  3. ;;; Advanced Technology Group
  4. ;;;
  5.  
  6. ;;;
  7. ;;; Record definitions for AppleTalk protocols
  8. ;;;
  9.  
  10. ;;; -------------------------------------------------------------------------------------------
  11. ;;; ADSP Record Definitions
  12.  
  13.  
  14.  
  15. ;    client control codes
  16.  
  17. (defconstant $dspInit    255)            ; create a new connection end
  18. (defconstant $dspRemove    254)            ; remove a connection end
  19. (defconstant $dspOpen    253)            ; open a connection
  20. (defconstant $dspClose    252)            ; close a connection
  21. (defconstant $dspCLInit    251)            ; create a connection listener
  22. (defconstant $dspCLRemove 250)            ; remove a connection listener
  23. (defconstant $dspCLListen 249)            ; post a listener rest
  24. (defconstant $dspCLDeny    248)            ; deny an open connection rest
  25. (defconstant $dspStatus    247)            ; get status of connection end
  26. (defconstant $dspRead 246)            ; read data from the connection
  27. (defconstant $dspWrite 245)            ; write data on the connection
  28. (defconstant $dspAttention 244)            ; send an attention message
  29. (defconstant $dspOptions 243)            ; set connection end options
  30. (defconstant $dspReset 242)            ; forward reset the connection
  31. (defconstant $dspNewCID 241)            ; generate a cid for a connection end
  32.  
  33.  
  34.  
  35.  
  36. ;    open connection modes
  37.  
  38. (defconstant $ocRequest 1)                        ; rest a connection with remote
  39. (defconstant $ocPassive 2)                ; wait for a connection rest from remote
  40. (defconstant $ocAccept 3)                ; accept rest as delivered by listener
  41. (defconstant $ocEstablish 4)                ; consider connection to be open
  42.  
  43.  
  44.  
  45.  
  46. ;    connection states
  47.  
  48. (defconstant $sListening 1)                ; for connection listeners
  49. (defconstant $sPassive 2)                ; waiting for a connection rest from remote
  50. (defconstant $sOpening 3)                ; resting a connection with remote
  51. (defconstant $sOpen 4)                        ; connection is open
  52. (defconstant $sClosing 5)                ; connection is being torn down
  53. (defconstant $sClosed 6)                 ; connection end state is closed
  54.  
  55.  
  56.  
  57.  
  58. ;    client event flags (bit-mask)
  59.  
  60. (defconstant $eClosed #x80)                ; received connection closed advice
  61. (defconstant $eTearDown #x40)                ; closed due to broken connection
  62. (defconstant $eAttention #x20)                ; received attention message
  63. (defconstant $eFwdReset #x10)                ; received forward reset advice
  64.  
  65.  
  66. ;    miscellaneous ates
  67.  
  68. (defconstant $attnBufSize 570)                ; size of client attention message
  69. (defconstant $dspPBSize 68)                ; byte size of largest dsp param block
  70. (defconstant $StdQSize 100000)                          ; standard send or receive queue size
  71.  
  72. ;;; connection control block
  73. (defrecord TRCCB
  74.   (ccbLink :pointer)                ; link to next ccb
  75.   (refNum :INTEGER)                    ; user reference number
  76.   (state :INTEGER)                      ; state of the connection end
  77.   (userFlags :Byte)                ; flags for unsolicited connection events
  78.   (localSocket :Byte)                ; socket number of this connection end
  79.   (remoteAddress :longint)              ; internet address of remote end (AddrBlock)
  80.   (attnCode :INTEGER)                    ; attention code received
  81.   (attnSize :INTEGER)                    ; size of received attention data
  82.   (attnPtr :pointer)                ; ptr to received attention data
  83.   (r1 :byte)   
  84.   (r1 :byte)    ; there SHOULD be a better way of doing this!!!
  85.   (r1 :byte)
  86.   (r1 :byte)
  87.   (r1 :byte)
  88.   (r1 :byte)
  89.   (r1 :byte)
  90.   (r1 :byte)
  91.   (r1 :byte)
  92.   (r1 :byte)
  93.   (r1 :byte)
  94.   (r1 :byte)
  95.   (r1 :byte)
  96.   (r1 :byte)
  97.   (r1 :byte)
  98.   (r1 :byte)
  99.   (r1 :byte)
  100.   (r1 :byte)
  101.   (r1 :byte)
  102.   (r1 :byte)
  103.   (r1 :byte)
  104.   (r1 :byte)
  105.   (r1 :byte)
  106.   (r1 :byte)
  107.   (r1 :byte)
  108.   (r1 :byte)
  109.   (r1 :byte)
  110.   (r1 :byte)
  111.   (r1 :byte)
  112.   (r1 :byte)
  113.   (r1 :byte)
  114.   (r1 :byte)
  115.   (r1 :byte)
  116.   (r1 :byte)
  117.   (r1 :byte)
  118.   (r1 :byte)
  119.   (r1 :byte)
  120.   (r1 :byte)
  121.   (r1 :byte)
  122.   (r1 :byte)
  123.   (r1 :byte)
  124.   (r1 :byte)
  125.   (r1 :byte)
  126.   (r1 :byte)
  127.   (r1 :byte)
  128.   (r1 :byte)
  129.   (r1 :byte)
  130.   (r1 :byte)
  131.   (r1 :byte)
  132.   (r1 :byte)
  133.   (r1 :byte)
  134.   (r1 :byte)
  135.   (r1 :byte)
  136.   (r1 :byte)
  137.   (r1 :byte)
  138.   (r1 :byte)
  139.   (r1 :byte)
  140.   (r1 :byte)
  141.   (r1 :byte)
  142.   (r1 :byte)
  143.   (r1 :byte)
  144.   (r1 :byte)
  145.   (r1 :byte)
  146.   (r1 :byte)
  147.   (r1 :byte)
  148.   (r1 :byte)
  149.   (r1 :byte)
  150.   (r1 :byte)
  151.   (r1 :byte)
  152.   (r1 :byte)
  153.   (r1 :byte)
  154.   (r1 :byte)
  155.   (r1 :byte)
  156.   (r1 :byte)
  157.   (r1 :byte)
  158.   (r1 :byte)
  159.   (r1 :byte)
  160.   (r1 :byte)
  161.   (r1 :byte)
  162.   (r1 :byte)
  163.   (r1 :byte)
  164.   (r1 :byte)
  165.   (r1 :byte)
  166.   (r1 :byte)
  167.   (r1 :byte)
  168.   (r1 :byte)
  169.   (r1 :byte)
  170.   (r1 :byte)
  171.   (r1 :byte)
  172.   (r1 :byte)
  173.   (r1 :byte)
  174.   (r1 :byte)
  175.   (r1 :byte)
  176.   (r1 :byte)
  177.   (r1 :byte)
  178.   (r1 :byte)
  179.   (r1 :byte)
  180.   (r1 :byte)
  181.   (r1 :byte)
  182.   (r1 :byte)
  183.   (r1 :byte)
  184.   (r1 :byte)
  185.   (r1 :byte)
  186.   (r1 :byte)
  187.   (r1 :byte)
  188.   (r1 :byte)
  189.   (r1 :byte)
  190.   (r1 :byte)
  191.   (r1 :byte)
  192.   (r1 :byte)
  193.   (r1 :byte)
  194.   (r1 :byte)
  195.   (r1 :byte)
  196.   (r1 :byte)
  197.   (r1 :byte)
  198.   (r1 :byte)
  199.   (r1 :byte)
  200.   (r1 :byte)
  201.   (r1 :byte)
  202.   (r1 :byte)
  203.   (r1 :byte)
  204.   (r1 :byte)
  205.   (r1 :byte)
  206.   (r1 :byte)
  207.   (r1 :byte)
  208.   (r1 :byte)
  209.   (r1 :byte)
  210.   (r1 :byte)
  211.   (r1 :byte)
  212.   (r1 :byte)
  213.   (r1 :byte)
  214.   (r1 :byte)
  215.   (r1 :byte)
  216.   (r1 :byte)
  217.   (r1 :byte)
  218.   (r1 :byte)
  219.   (r1 :byte)
  220.   (r1 :byte)
  221.   (r1 :byte)
  222.   (r1 :byte)
  223.   (r1 :byte)
  224.   (r1 :byte)
  225.   (r1 :byte)
  226.   (r1 :byte)
  227.   (r1 :byte)
  228.   (r1 :byte)
  229.   (r1 :byte)
  230.   (r1 :byte)
  231.   (r1 :byte)
  232.   (r1 :byte)
  233.   (r1 :byte)
  234.   (r1 :byte)
  235.   (r1 :byte)
  236.   (r1 :byte)
  237.   (r1 :byte)
  238.   (r1 :byte)
  239.   (r1 :byte)
  240.   (r1 :byte)
  241.   (r1 :byte)
  242.   (r1 :byte)
  243.   (r1 :byte)
  244.   (r1 :byte)
  245.   (r1 :byte)
  246.   (r1 :byte)
  247.   (r1 :byte)
  248.   (r1 :byte)
  249.   (r1 :byte)
  250.   (r1 :byte)
  251.   (r1 :byte)
  252.   (r1 :byte)
  253.   (r1 :byte)
  254.   (r1 :byte)
  255.   (r1 :byte)
  256.   (r1 :byte)
  257.   (r1 :byte)
  258.   (r1 :byte)
  259.   (r1 :byte)
  260.   (r1 :byte)
  261.   (r1 :byte)
  262.   (r1 :byte)
  263.   (r1 :byte)
  264.   (r1 :byte)
  265.   (r1 :byte)
  266.   (r1 :byte)
  267.   (r1 :byte)
  268.   (r1 :byte)
  269.   (r1 :byte)
  270.   (r1 :byte)
  271.   (r1 :byte)
  272.   (r1 :byte)
  273.   (r1 :byte)
  274.   (r1 :byte)
  275.   (r1 :byte)
  276.   (r1 :byte)
  277.   (r1 :byte)
  278.   (r1 :byte)
  279.   (r1 :byte)
  280.   (r1 :byte)
  281.   (r1 :byte)
  282.   (r1 :byte)
  283.   (r1 :byte)
  284.   (r1 :byte)
  285.   (r1 :byte)
  286.   (r1 :byte)
  287.   (r1 :byte)
  288.   (r1 :byte)
  289.   (r1 :byte)
  290.   (r1 :byte)
  291.   (r1 :byte)
  292.   (r1 :byte)
  293.   (r1 :byte)
  294.   (r1 :byte)
  295.   (r1 :byte)
  296.   (r1 :byte)
  297.   (r1 :byte)
  298.   (r1 :byte)
  299.   (r1 :byte)
  300.   (r1 :byte)
  301.   (r1 :byte)
  302.   (r1 :byte))
  303.  
  304.  
  305. ;;; driver control call parameter block
  306.  
  307. (defconstant $remoteAddress 38)
  308.  
  309. (defrecord DSPParamBlock
  310.   (qLink :pointer)                      ; QElemPtr
  311.   (qTypeK :INTEGER)
  312.   (ioTrap :INTEGER)
  313.   (ioCmdAddr :pointer)
  314.   (ioCompletion :pointer 0)             ; ProcPtr
  315.   (ioResult :INTEGER)                   ; OSErr
  316.   (ioNamePtr :pointer)                  ; StringPtr
  317.   (ioVRefNum :INTEGER)
  318.   (ioCRefNum :INTEGER)            ; adsp driver refNum
  319.   (csCode :INTEGER)            ; adsp driver control code
  320.   (qStatus :LONGINT)            ; adsp internal use
  321.   (ccbRefNum :INTEGER)            ; refnum of ccb
  322.   (variant (                            ; ---- dspInit, dspCLInit: ----
  323.             (ccbPtr :pointer)        ; pointer to connection control block (TPCCB)
  324.         (userRoutine :pointer)    ; client routine to call on event (ProcPtr)
  325.             (sendQSize :INTEGER)        ; size of send queue (0..64K bytes)
  326.             (sendQueue :pointer)    ; client passed send queue buffer
  327.             (recvQSize :INTEGER)    ; size of receive queue (0..64K bytes)
  328.             (recvQueue :pointer)    ; client passed receive queue buffer
  329.             (attnPtr :pointer)        ; client passed receive attention buffer
  330.             (localSocket :Byte)        ; local socket number
  331.             (filler1 :Byte))        ; filler for proper byte alignment
  332.            (                            ; ---- dspOpen, dspCLListen, dspCLDeny: ----
  333.             (localCID :INTEGER)        ; local connection id
  334.             (remoteCID :INTEGER)    ; remote connection id
  335.             (remoteAddress :longint)    ; address of remote end (AddrBlock)
  336.             (filterAddress :longint)    ; address filter (AddrBlock)
  337.             (sendSeq :LONGINT)        ; local send sequence number
  338.             (sendWindow    :INTEGER)    ; send window size
  339.             (recvSeq :LONGINT)        ; receive sequence number
  340.             (attnSendSeq :LONGINT)    ; attention send sequence number
  341.             (attnRecvSeq :LONGINT)    ; attention receive sequence number
  342.             (ocMode :Byte)        ; open connection mode
  343.             (ocInterval :Byte)        ; open connection request retry interval
  344.             (ocMaximum :Byte)        ; open connection request retry maximum
  345.             (filler2 :Byte))        ; filler for proper byte alignment
  346.            (                            ; ---- dspClose, dspRemove: ----
  347.             (abort :Byte)        ; abort connection immediately if non-zero
  348.             (filler3 :Byte))        ; filler for proper byte alignment
  349.            (                            ; ---- dspStatus: ----
  350.             (statusCCB :pointer)    ; pointer to ccb (TPCCB)
  351.             (sendQPending :INTEGER)    ; pending bytes in send queue
  352.             (sendQFree :INTEGER)    ; available buffer space in send queue
  353.             (recvQPending :INTEGER)    ; pending bytes in receive queue
  354.             (recvQFree :INTEGER))    ; available buffer space in receive queue
  355.            (                            ; ---- dspRead, dspWrite: ----
  356.             (reqCount :INTEGER)        ; requested number of bytes
  357.             (actCount :INTEGER)      ; actual number of bytes
  358.             (dataPtr :pointer)        ; pointer to data buffer
  359.             (eom :Byte)          ; indicates logical end of message
  360.             (flush :Byte))        ; send data now
  361.        (                        ; ---- dspAttention: ----
  362.             (attnCode :INTEGER)        ; client attention code
  363.             (attnSize :INTEGER)        ; size of attention data
  364.             (attnData :pointer)        ; pointer to attention data
  365.             (attnInterval :Byte)    ; retransmit timer in 10-tick intervals
  366.             (filler4 :Byte))        ; filler for proper byte alignment
  367.            (                        ; ---- dspOptions: ----
  368.             (sendBlocking :INTEGER)    ; quantum for data packets
  369.             (sendTimer :Byte)        ; send timer in 10-tick intervals
  370.             (rtmtTimer :Byte)        ; retransmit timer in 10-tick intervals
  371.             (badSeqMax :Byte)        ; threshold for sending retransmit advice
  372.             (useCheckSum :Byte))    ; use ddp packet checksum
  373.            (                            ; ---- dspNewCID: ----
  374.             (newCID :INTEGER))))    ; new connection id returned
  375.  
  376.  
  377. (provide :network-defs)